unit attackmotionselectionformunit;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ButtonPanel;

type

  { TAttackMotionSelectionForm }

  TAttackMotionSelectionForm = class(TForm)
    MotionComboBox: TComboBox;
    ImageComboBox: TComboBox;
    MotionLabel: TLabel;
    ImageLabel: TLabel;
    ResultButtonPanel: TButtonPanel;
  private
  public
    SelectedMotionId: Integer;
    SelectedImageId: Integer;
    function Select(MotionId, ImageId: Integer): Boolean;

  end;

var
  AttackMotionSelectionForm: TAttackMotionSelectionForm;

implementation

{$R *.lfm}

uses
  comboboxhelper, namehelper;

{ TAttackMotionSelectionForm }

function TAttackMotionSelectionForm.Select(MotionId, ImageId: Integer): Boolean;
begin
  FillNamesComboBox(MotionComboBox, @GetBattleMotionTypeName, 0, 2);
  FillNamesComboBox(ImageComboBox, @GetWeaponImageName, 0, 30);

  MotionComboBox.ItemIndex := MotionId;
  ImageComboBox.ItemIndex := ImageId;

  ShowModal;

  SelectedMotionId := MotionComboBox.ItemIndex;
  SelectedImageId := ImageComboBox.ItemIndex;

  Select := ModalResult = mrOk;
end;

end.

